package cn.script.game.dup;

import cn.script.call_api.AfterApi;
import cn.script.call_api.BeforeApi;
import cn.script.domain.Point;
import cn.script.game.GameOpt;
import cn.script.game.prof.Pi;
import cn.script.util.Delay;

public class BgDup extends AbstractDup {

    public BgDup(Pi pi, GameOpt gameOpt) {
        super("混沌冰宫[副本]", pi, gameOpt);
    }

    @Override
    protected BeforeApi beFore() {
        return () -> {
            this.go.toBack();
            this.go.wio().keypress("f11",500);
            this.go.moveTo("凌霄城").winPoint(445,367)
                    .gamePoint(270,228).rPoint(0,0).opt();
            this.go.wio().leftClick(Point.point(532,208));
            Delay.delay(500);
//            this.go.wio().leftClick(Point.point(112,330));
//            this.go.npc("众神的亡灵");
            this.go.text_click("免门票");
            this.go.wio().keypress("f10",500);
            Delay.delay(1000);
            return 1;
        };
    }

    @Override
    public DupInfo dupInfo() {
        DupInfo dupInfo = new DupInfo(this.go, this.optName);
        dupInfo.dupOpt("混沌冰宫伏地魔[真身]")
                .a_skills(this.pi.skills())
                .m_winPoint(270,308)
                .m_gamePoint(123,256)
                .m_rPoint(8,8)
                .a_endNum(5)
                .a_timeOut(30000);
        dupInfo.dupOpt("混沌冰宫造物者[真身]")
                .a_skills(this.pi.skills())
                .m_winPoint(381,321)
                .m_gamePoint(192,214)
                .m_rPoint(8,8)
                .a_endNum(5)
                .a_timeOut(30000);
        dupInfo.dupOpt("混沌冰宫牛魔王[真身]")
                .a_skills(this.pi.skills())
                .m_winPoint(528,315)
                .m_gamePoint(259,134)
                .m_rPoint(8,8)
                .a_endNum(5)
                .a_timeOut(30000);
        return dupInfo;
    }

    @Override
    protected AfterApi after() {
        return ()->{
//            this.go.toBack();
//            Delay.delay(5000);
            return 1;
        };
    }
}
